1. Field of the Invention
The present invention relates to an image forming apparatus, an image forming method and a program that transform edges of an image such as trapping.
2. Description of the Related Art
There has been a method of changing, for a bitmap image, pixel values of pixels that are distant from edges of the image as a process of transforming the edges of the image such as image thickening or trapping (see, for example, Japanese Patent Laid-Open No. 2001-189849 or Japanese Patent Laid-Open No. 2007-036699). Here, the pixel value is a value that defines, for example, color, density, and brightness of a pixel.
With the method described above, a square reference area having a width twice as long as a specified modification width is obtained, with a pixel-of-interest as the center, so that pixels that are distant from the edge can also be modified. Ensuring a wide reference area allows determination of an edge of an image that is distant from the pixel-of-interest and transformation of the edge of the image.
<Prior Art 1>
For example, there is a prior art 1 that can obtain an image 402 by performing a process 401 on an image, such as an image 400 of FIG. 4A, in which cyan and magenta plates are adjacent to each other. Although the image 900 and the process 401 are shown side by side in FIG. 4A, actual processing is performed on respective pixels of the image 400, having predefined pixels-of-interests 401_1 to 401_5. The resulting image is shown by reference numeral 402. The following FIGS. 5A, 5B, 5C, 5D, 6, 8A, 8B, 9A, 9B, 10A, 10B, 14, 17A and 17B are to be viewed in a similar manner.
FIG. 3 is a flow chart of an image processing of the prior art 1.
In the process 401, if the trapping width is two pixels, for example, a memory corresponding to the pixels of the image 401_1 is obtained, i.e., an area extending above and below the pixel-of-interest 401_3 by two pixels each. (Here, a memory corresponding to three lines including the line of the pixel-of-interest is obtained because there is no pixel upper than the pixel-of-interest 401_3).
First, a reference area obtaining process is performed at S301_0 of FIG. 3, which passes the setting value of the trapping width from a register setting unit 302 and obtains a reference area 401_4.
Next, an inside-reference-area color plate determination process is performed at S301_1, where pixels in the reference area 401_4 are compared with the pixel-of-interest. Specifically, it is determined at S301_1 whether there are different color plates in the pixel-of-interest and pixels of the reference area.
If it is determined at S301_1 that there are different color plates in the pixel-of-interest and the pixels of the reference area, the process flow proceeds to S301_2. If, on the other hand, it is determined at S301_1 that there is no different color plate in the pixel-of-interest and the pixels of the reference area, the process flow proceeds to S301_3.
For example, in FIG. 4A, because there is no different color plate in the pixel-of-interest and the pixels of the reference area 401_4, trapping is not performed.
Therefore, the process flow proceeds to an unprocessed pixel detection process (S301_3).
The unprocessed pixel detection process is performed at S301_3, and because there still exists an unprocessed pixel the process flow proceeds to a pixel update process (S301_4).
As thus described, the process is performed sequentially while shifting the reference area by one pixel at a time, and the image 402 is obtained when the process is performed up to the pixel-of-interest 401_5 of the memory of the image 401_2.
Next, when there are two different color plates in the reference area such as image 403_1 of FIG. 4B, trapping is performed on pixel-of-interest 403_3. It is determined in the inside-reference-area color plate determination process (S301_1) that there are different color plates in the reference area, and the process flow proceeds to a modification process (S301_2), where trapping is performed. Subsequently, the process flow proceeds to the unprocessed pixel detection process (S301_3) to detect unprocessed pixels, and the process flow proceeds to the pixel update process (S301_4). Such processes are performed up to the pixel-of-interest 403_4 of image 403_2 and an image 404 is obtained as a result of trapping.
Finally, the above process is repeated also on the remaining images of the image 400 on which the above process has not been performed, and thereby an image 406 is finally obtained.
Specifically, the inside-reference-area color plate determination process (S301_1) determines, for a pixel-of-interest 405_3 of an image 405_1, that there is no different color plate in the reference area. The process flow then proceeds to the unprocessed pixel detection process (S301_3). At S301_3, unprocessed pixels are detected and the process flow proceeds to the pixel update process (S301_4). The process is performed up to a pixel-of-interest 405_4 of an image 405_2.
The above process allows trapping from a boundary of an image to both sides with a trapping width of two pixels.
Although trapping (a process of thickening or thinning only a particular area of an image) has been described, the above process is also capable of thickening or thinning the entire bitmap image.
<Prior Art 2>
A prior art 2 that reduces the memory required for image trapping will be described below.
As an example, a process will be described which performs trapping for a case, such as an image 1400 of FIG. 14, where an image of the cyan plate and an image of the magenta plate are adjacent to each other along the sub-scanning direction.
First, an image of two lines from the image 1400, such as an image 1401_1 of FIG. 14, is written into the memory. Here, only the line of the pixel-of-interest is written because there is no pixel upper than a pixel-of-interest 1401_3.
Next, a 2×2 reference area 1401_4 is obtained around the pixel-of-interest 1401_3.
Then, the pixel-of-interest is modified, referring to the color plate that is different from that of the pixel-of-interest in the reference area. Here, the pixel-of-interest is not modified because there is no different color plate in the reference area.
Next, the modified pixel-of-interest is output as an output image, and the process flow proceeds to the next pixel-of-interest. Repeating the process in the image 1401_2 written into the memory until the pixel-of-interest comes to 1401_5, an image 1402 is obtained after the process is completed.
Next, an image of two lines including a pixel-of-interest 1403_3, such as an image 1403_1 of FIG. 14, is written into the memory.
Then, a 2×2 reference area 1403_4 is obtained around the pixel-of-interest 1403_3. The pixel-of-interest is then modified, referring to the color plate that is different from that of the pixel-of-interest in the reference area 1403_4.
Next, the modified pixel-of-interest is output as an output image. Then, modification information described below is generated, and the process flow proceeds to the next pixel-of-interest. The process is performed along the main-scanning direction up to a pixel-of-interest 1403_5 of an image 1403_2 written into the memory. As a result of this process, an image 1404 is obtained. In addition, the modification information is generated as an image 1405_6.
A pixel-of-interest is thereafter updated along the sub-scanning direction. Here, an image 1405_1 of two lines including a pixel-of-interest 1405_3 is written into the memory in a similar manner.
A 2×2 reference area 1405_4 is then obtained around a pixel-of-interest 1405_3.
There is no color plate different from that of an edge or the pixel-of-interest in the reference area 1405_4. Referring to the image 1405_6 included in the previously generated modification information, however, the color plates of the pixel-of-interest and the image 1405_6 included in the modification information are different, and thus the pixel-of-interest is modified. An image 1406 is obtained by performing the above modification process along the main-scanning direction up to a pixel-of-interest 1405_5 of an image 1405_2 written into the memory.
Finally, for the remaining images that have not gone through the process of the image 1400, an image 1407_1 of two lines including a pixel-of-interest 1407_3 is written into the memory by a process 1407.
A 2×2 reference area 1407_4 is then obtained around the pixel-of-interest 1407_3.
Then, referring to a color plate different from that of the pixel-of-interest in the reference area, the pixel-of-interest is modified and output. Here, trapping is not performed because there is no different color plate in the reference area.
Performing the above-mentioned process sequentially up to a pixel-of-interest 1407_5 of an image 1407_2 written into the memory gives an image 1408 including a part 1409 on which trapping (a process of thickening the magenta plate) has been performed along a direction from the magenta plate to the cyan plate.
In the prior art 2, the information preserved by the line memory includes the reference area and modification information. Here, the number of lines corresponding to the height of the reference area is one, and thus reducing the memory required for the modification information can suppress the amount of line memory required for the prior-art 2.
Depending on the hardware, however, there are the following problems when performing trapping or a process of thickening or thinning the image. That is, a number of lines corresponding to the height of the reference area must be preserved in the memory for the pixels-of-interest 1301 and 1303 as shown in FIGS. 13A and 13B, for example, in the prior art 1. This is because a wide reference area must be obtained by the reference area obtaining process (S301_0) in the prior art 1, since the inside-reference-area color plate determination process (S301_1) must determine whether there are different color plates in the reference area.
In other words, in the prior art 1, a reference area twice as wide as the trapping width specified by the user must be obtained, which requires a large amount of cost.
Additionally with the prior art 1, because the process is performed in a pixel-by-pixel manner, a larger number of pixels must be processed to obtain the same trapping width along with increase of resolution, which requires a larger amount of line memory.
As shown in FIG. 15, for example, three pixels are required with a resolution of 600 dpi in order to obtain a trapping width of about 120 μm, and thus a line memory of six lines is necessary. With a resolution of 1200 dpi, a line memory of 12 lines is necessary.
Additionally, with the prior art 2, although the magenta plate can be thickened in the finally obtained image 1408, the cyan plate cannot be thickened, as shown in FIG. 14. This is because the pixel-of-interest can only be modified in the process direction from the pixel-of-interest due to inadequacy of the modification information. With the prior art 2, accordingly, there may be portions where pixel information of the edge portion can or cannot be modified, depending on the direction of the image transformation process.
It is therefore an object of the present invention to solve the problems of the prior art.